Method and arrangement for video coding

ABSTRACT

A hybrid video encoder which carries out motion estimation and compensation ( 8 ) in the transform domain. In such an encoder, the calculation of a prediction block (Ŷ) from previously encoded blocks (Z) stored in the transform-domain frame memory ( 7 ) requires a large number of multiplications. This applies particularly to the motion estimation algorithm. In accordance with the invention, only a few DCT coefficients of candidate prediction blocks are calculated, for example, the DC coefficient and some AC coefficients. In a preferred embodiment, the AC coefficients are adaptively selected in dependence upon the motion vector which is being considered. The calculated coefficients of the candidate prediction blocks and the corresponding coefficients of the current input picture block (Y) are then compared to identify the best-matching prediction block.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The invention relates to a method of coding video pictures, comprising the steps of transforming picture blocks of a video picture into transform coefficients, and encoding the difference between the transform coefficients of each transformed picture block and corresponding transform coefficients of a prediction block which is obtained by applying motion estimation to a previously encoded picture. The invention also relates to an arrangement for carrying out the method.

2. Description of the Related Art

Video encoders operating in accordance with international coding standards such as MPEG and H.261 are hybrid encoders, in which transform coding and predictive coding are combined. The predictive coding, which includes motion estimation and compensation, is usually carried out in the pixel domain, and the transform coding (DCT) is applied to the predictively coded signal. In such encoders, an inverse DCT is required in the prediction loop.

Nowadays, research effort is being spent on carrying out the predictive coding in the transform domain. In such an embodiment of the hybrid encoder, the picture is transformed first and the predictive coding is then applied to the transform coefficients. The inverse DCT can now be dispensed with. A schematic diagram of such a hybrid video encoder has been published by the University of Maryland on the Internet (http://dspserv.eng.umd.edu:80..\˜koc\/project/Video_Coding.html).

A drawback of the prior-art hybrid video encoder is that motion estimation and compensation in the transform domain are more complex than in the pixel domain because the calculation of a prediction block involves a large number of matrix multiplications. In particular, motion estimation is a severe problem. Motion estimation comprises the steps of calculating a plurality of candidate prediction blocks, comparing each candidate prediction block with the transformed picture block, and selecting one of the candidate prediction blocks to be the prediction block. With each plurality of candidate prediction blocks, said large number of calculations is involved.

It is an object of the invention to provide a method of video encoding, alleviating the above mentioned drawbacks.

To achieve these and other objects, the method in accordance with the invention is characterized in that the steps of calculating a candidate prediction block and comparing the candidate prediction block with the transformed picture block, are carried out for a subset of the transform coefficients of said candidate prediction block and transformed picture block.

The invention is based on the recognition that the majority of bits for encoding a picture block are usually spent on a few transform coefficients and that it is beneficial to restrict the search for the most-resembling prediction block to these coefficients. The number of multiplications is considerably reduced thereby, in particular, in coding standards such as MPEG, where motion compensation is applied to 16*16 macroblocks comprising four 8*8 luminance blocks. Note that the eventually selected prediction block for the motion compensation will still be calculated completely. Picture quality is thus not affected.

Advantageously, the subset of transform coefficients comprises the DC coefficient and a predetermined number of adjacent AC coefficients, for example, the coefficients constituting a 2*2 or 3*3 submatrix in the upper left corner of an 8*8 block. The submatrix may extend in the horizontal direction (for example, 2*3 or 2*4) because most of the motion in normal video scenes is found to be horizontal. The number of multiplications is even further reduced when only coefficients of a single row or single column are calculated.

In a preferred embodiment, the coefficients are chosen in dependence upon the represented by the candidate prediction block and expressed by its associated candidate motion vector. If the candidate motion vector represents horizontal motion, a submatrix is chosen which substantially extends in the horizontal direction. If the candidate motion vector represents vertical motion, the submatrix chosen substantially extends in the vertical direction.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows a hybrid encoder carrying out motion estimation in the transform domain in accordance with the invention,

FIG. 2 shows two phases of a moving object in the pixel domain,

FIG. 3 shows an example of the relative position of a prediction block with respect to previously encoded blocks in the transform domain,

FIGS. 4A-4C and 5A-5D show examples of subsets of coefficients selected for carrying out motion estimation,

FIG. 6 shows a flowchart illustrating the operations of a motion estimation and compensation circuit which is shown in FIG. 1,

FIG. 7 shows an example of the relative position of a prediction macroblock block with respect to previously encoded blocks in the transform domain.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

FIG. 1 shows a hybrid encoder carrying out motion estimation in the transform domain in accordance with the invention. The encoder receives a video picture signal in the form of picture blocks X of 8*8 pixels. Each pixel block is transformed by a discrete cosine transform circuit 1 into a block Y of 8*8 DCT coefficients. In a subtracter 2, the coefficients of a prediction block Y are subtracted from the corresponding coefficients of block Y to obtain a block of 8*8 difference coefficients. The difference coefficients are quantized in a quantizer 3 and the quantized difference coefficients are then encoded into variable-length code words by a variable-length encoder 4. The variable-length code words constitute the digital output bitstream of the hybrid encoder. This bitstream is applied to a transmission channel or stored on a storage medium (not shown).

In a prediction loop, the quantized difference coefficients are subjected to inverse quantization in an inverse quantizer 5, added to the current prediction block by an adder 6, and written into in a frame memory 7 to update the previously encoded picture stored therein. The picture blocks stored in frame memory 7 are denoted Z. Note that they are stored in the transform domain. A motion estimator and motion compensator circuit 8 receives the current picture block and searches in the frame memory 7 the prediction block Ŷ which most resembles said picture block. The position of the prediction block thus found is identified by a motion vector mv which defines the position of the prediction block with respect to the current block position. The motion vector mv is applied to the variable-length encoder 4 and is part of the output bitstream.

In the past, motion compensation used to be carried out in the pixel domain. This is shown by way of example, in FIG. 2 which shows two phases of a moving object 10 in the pixel domain. In the Figure, a picture segment 11, comprising twelve 8*8 pixel blocks of the picture to be coded and a corresponding picture segment 12 of the previously encoded picture stored in a frame memory are shown. Reference numeral 13 denotes an 8*8 pixel block X to be coded and reference numeral 14 denotes the most-resembling prediction block {circumflex over (X)} in the frame memory. Also shown is the motion vector mv associated with the prediction block {circumflex over (X)}. Once this motion vector has been found by motion estimation, the prediction block can easily be obtained by reading the relevant pixels of prediction block {circumflex over (X)} from the frame memory.

In contrast therewith, the hybrid decoder shown in FIG. 1 stores the previously encoded picture in the transform domain. The coefficients of the prediction block Ŷ must now be calculated from coefficient blocks Z stored in the memory. This is shown, by way of example, in FIG. 3 which shows that the coefficients of a prediction block Ŷ are to be calculated from four underlying coefficient blocks Z₁, Z₂, Z₃ and Z₄. In mathematical notation, the prediction block follows from the equation: $\begin{matrix} {\hat{Y} = {\sum\limits_{i = 1}^{4}{H_{i}Z_{i}W_{i}}}} & (1) \end{matrix}$

where H_(i) and W_(i) are transform matrices representing the relative position of the block Ŷwith respect to the underlying blocks. H_(i) and W_(i) have one of the formats $\begin{pmatrix} 0 & 0 \\ I & 0 \end{pmatrix}\quad {and}\quad \begin{pmatrix} 0 & I \\ 0 & 0 \end{pmatrix}$

and

where I is an identity matrix and 0 is a matrix of zeroes. A theoretical background of equation (1) can be found, inter alia, in U.S. Pat. No. 5,408,274.

The above calculation of the coefficients of the prediction block presumes knowledge of the matrices H_(i) and W_(i), i.e., knowledge of the motion vector mv. It is the purpose of a motion estimator (included in circuit 8 in FIG. 1) to determine the motion vector of the prediction block which most resembles the current input block. Motion estimation is a very complicated process, even in the pixel domain, and much research effort has been spent to find cost-effective and well-performing motion estimation algorithms. In fact, motion estimation is an iterative process of applying motion compensation to a plurality of candidate prediction blocks and selecting an optimal prediction block from said candidates. Hereinafter, an algorithm known as 3-Dimensional Recursive Search (3DRS) block matching algorithm will be referred to by way of example. This algorithm is disclosed, inter alia, in Applicant's U.S. Pat. 5,072,293. A pleasant property of the 3DRS motion estimation algorithm is that only a restricted number of candidate motion vectors are to be evaluated.

In view of the recognition that motion estimation is similar to repeatedly applying motion compensation to a plurality of candidate prediction blocks, motion estimation in the transform domain requires equation (1) to be calculated several times. This requires a large number of multiplications. In accordance with the invention, the calculation of each candidate prediction block in accordance with equation (1) is carried out for a restricted number of coefficients only. This reduces the number of multiplications so dramatically that a one-chip MPEG2 encoder operating in the transform domain becomes feasible. Needless to say that this a great step in the field of digital video processing.

The coefficients to be calculated for the purpose of motion estimation can be fixedly chosen. Preferably, they include the DC coefficient and a few AC coefficients representing lower spatial frequencies. That is because these coefficients are responsible for the majority of bits in the output signal and are thus most worthwhile to be minimized in the 15 difference block (output of subtracter 2 in FIG. 1). FIGS. 4A-4C show examples of preferred choices. In each example, the upper-left coefficient is the DC coefficient. In FIG. 4A, the coefficients constitute a 3*3 (or any other size) submatrix. In FIG. 4B, the selected coefficients are the first coefficients of a zigzag scanned series. This choice is advantageous in view of already available circuits for zigzag scanning coefficient blocks. In FIG. 4C, the submatrix extends in the horizontal direction. The latter choice benefits from the property that most of the motion found in plain video scenes is horizontal motion.

In a preferred embodiment of the invention, the coefficients to be calculated for the purpose of motion estimation are adaptively chosen in dependence upon the candidate motion vectors which are being evaluated. If the candidate motion vectors represent horizontal motion (which in the 3DRS algorithm is the case if substantially horizontal motion has been found previously), a submatrix is chosen which extends in the horizontal direction.

Examples thereof are shown in FIGS. 5A and 5B. If the candidate motion vectors represent vertical motion, the submatrix extends in the vertical direction as shown in FIGS. 5C and SD.

The examples shown in FIGS. 5B and 5D are particularly advantageous because the calculation on of the coefficients of a single row or column drastically contributes to saving the number of multiplications (8 coefficients constituting a single row can more economically be computed than 8 coefficients constituting a 2*4 submatrix). It is further noted that the AC coefficients chosen are not necessarily contiguous to the DC coefficient. Because small amounts of motion become manifest as higher spatial frequencies in the difference block (output of subtracter 2 in FIG. 1), it may also be advantageous to evaluate AC coefficients representing higher spatial frequencies for small amounts of motion.

The operation of the motion estimation and motion compensation circuit 8 (FIG. 1) will now be described. Because it has to successively carry out a plurality of identical operations each involving a number of calculations, the circuit is preferably implemented as a microprocessor-controlled arithmetic unit. The architecture of such a unit is well-known to those skilled in the art and therefore not shown in more detail. For the purpose of disclosing the invention, FIG. 6 shows a flowchart of operations which are carried out by the microprocessor controlling the arithmetic unit. It is assumed that the 3DRS motion estimation algorithm is used and that the candidate motion vectors mvk (k=1 . . . K) are known in advance.

In a first step 20, the processor determines which subset of DCT coefficients are taken into account for the motion estimation process. As already discussed above, the set may be fixedly chosen (cf. FIGS. 4A-4C) or adaptively selected in dependence upon the candidate motion vectors (cf. FIGS. 5A-5D). In the step 20, the coefficients are expressed in terms of indexes (u=0 . . . 7, v=0 . . . 7) indicating their positions in the coefficient matrix.

In a step 21, the microprocessor selects one of the candidate motion vectors mv_(k). Then, in a step 22, the processor retrieves the four coefficient blocks underlying the candidate prediction block associated with this motion vector from the frame memory. In accordance with equation (1), said four blocks are denoted Z₁ . . . Z₄.

In a step 23, the relevant coefficients of the candidate prediction block are calculated in accordance with equation (1). The coefficients are denoted ŷ_(u,v). Note that only the coefficients ŷ_(u,v) are calculated having an index (u,v) to be taken into account as has been determined in the step 20.

In a step 24, the microprocessor compares the set of coefficients ŷ_(u,v) with the corresponding coefficients ŷ_(u,v) of the current input block. The result thereof is stored as a resemblance indicator R_(k) for the current candidate motion vector mv_(k.) In this example, the resemblance indicator is indicative of the mean absolute difference between input block and candidate prediction block in the transform domain: $R_{k} = {\sum\limits_{u,v}{w_{u,v}{{y_{u,v} - {\hat{y}}_{u,v}}}}}$

where w_(u,v) is a weighting factor indicating the relative relevance of the respective coefficient. In video compression schemes, such as MPEG, the quantizer matrix provides appropriate weighting factors. In a simple embodiment, all weighting factors w_(u,v) may be set to one.

In a step 25, it is tested whether all candidate motion vectors mv_(k) (k=1 . . . K) have been processed in this manner. As long as this is not the case, the steps 21-24 are repeated for the other candidate motion vectors mv_(k). If all candidate motion vector have been processed, the motion estimation process proceeds with a step 26 in which it is determined which of the stored resemblance indicators R_(k) (k=1 . . . K) has the smallest value. The best-matching one of the candidate prediction blocks has now been identified and the motion estimation process is finished.

The arithmetic unit now proceeds with motion compensation. To this end, the motion vector mv_(k) of the best-matching prediction block just found is again selected in a step In a step 31, the four underlying blocks Z₁ . . . Z₄ are re-read from the frame memory. In a step 32, all coefficients of the prediction block Ŷ are calculated in accordance with equation (1). Note the difference of this step 32 with the alleged similar step 23 in the motion estimation process. In the step 32, all the coefficients are calculated whereas the step 23 applies to a few coefficients only. The block Ŷ is applied to the subtracter 2 (see FIG. 1) of the hybrid encoder.

In the above described embodiment, the candidate prediction blocks have the same size as the underlying previously encoded blocks. Some coding standards, such as H.263, provide an option (“advanced motion estimation”) to transmit a motion vector for each 8*8 block. The described embodiment can advantageously be implemented in a hybrid encoder in accordance with such a standard. Other coding standards, such as MPEG, transmit one motion vector for each macroblock which includes four 8*8 blocks. For such coding standards, the process of motion estimation and compensation is slightly different, as will now be explained with reference to FIG. 7.

FIG. 7 shows a (candidate) prediction macroblock 40 comprising four 8*8 blocks Ŷ₁-Ŷ₄. The macroblock now covers nine previously encoded coefficient blocks Z₁-Z₉.

To calculate the coefficients of the macroblock, each 8*8 block is individually calculated from its four underlying blocks in accordance with equation (1). The motion estimation and compensation process further proceeds as described above with reference to FIG. 6. For the purpose of motion compensation, all the coefficients (a total of 4*64 in total) are calculated (step 32). For the purpose of motion estimation, only the selected coefficients are calculated (step 23), and the corresponding coefficients are taken from the input macroblock for determining the resemblance indicator (step 25).

In summary, a hybrid video encoder is disclosed which carries out motion estimation and compensation (8) in the transform domain. In such an encoder, the calculation of a prediction block (Ŷ) from previously encoded blocks (Z) stored in the transform-domain frame memory (7) requires a large number of multiplications. This applies particularly to the motion estimation algorithm. In accordance with the invention, only a few DCT coefficients of candidate prediction blocks are calculated, for example, the DC coefficient and some AC coefficients. In a preferred embodiment, the AC coefficients are adaptively selected in dependence upon the motion vector which is being considered. The calculated coefficients of the candidate prediction blocks and the corresponding coefficients of the current input picture block (Y) are then compared to identify the best-matching prediction block. 

What is claimed is:
 1. A method of coding video pictures, comprising the steps: transforming picture blocks of a video picture into transform coefficients; applying motion estimation to a previous encoded picture thereby forming a prediction block; and encoding the difference between the transform coefficients of each transformed picture block and corresponding transform coefficients of said prediction block, wherein the motion estimation step comprises the steps: calculating a plurality of candidate prediction blocks; comparing each candidate prediction block with the transformed picture block; and selecting one of the candidate prediction blocks to be the prediction block, wherein the steps of calculating a candidate prediction block and comparing the candidate prediction block with the transformed picture block are carried out for a subset of the transform coefficients of said candidate prediction block and transformed picture block; wherein the subset of transform coefficients is adaptively chosen in dependence upon a candidate motion vector associated with the candidate prediction block.
 2. The method as claimed in claim 1, wherein the subset of transform coefficients comprises a DC coefficient and a predetermined number of AC coefficients; wherein the subset of transform coefficients is adaptively chosen in dependence upon a candidate motion vector associated with the candidate prediction block.
 3. The method as claimed in claim 1, wherein the subset of transform coefficients comprises the first N coefficients of the first M rows of the candidate prediction block, N and M being chosen in dependence upon the horizontal and vertical component, respectively, of the candidate motion vector.
 4. The method as claimed in claim 3, wherein N=1 for candidate motion vectors having a substantial vertical component, and M=1 for candidate motion vectors having a substantial horizontal component.
 5. The method as claimed in claim 1, wherein said step of comparing each candidate prediction block with the transformed prediction block includes comparing spatially corresponding coefficients, predetermined weighting factors being applied to said spatially corresponding coefficients.
 6. The method as in claim 1, wherein the candidate prediction blocks are chosen in accordance with a 3-dimensional recursive block matching algorithm.
 7. A block-based hybrid video encoder comprising: a transform encoder circuit for transforming picture blocks of a video picture into transform coefficient; and a predictive encoder comprising: a motion estimator for forming a prediction block from a previously encoded picture; means for forming a difference between each transformed picture block and said prediction block; and means for encoding said difference, wherein the motion estimator comprises: means for calculating a plurality of candidate prediction blocks; means for comparing each candidate prediction block with the transformed picture block; and means for selecting one of the candidate prediction blocks to be the prediction block, wherein said calculating means and said comparing means operate on a subset of transform coefficients of said candidate prediction block and transformed picture block; wherein the subset of transform coefficients is adaptively chosen in dependence upon a candidate motion vector associated with the candidate prediction block. 